import KoaRouter from 'koa-router'
import Config from '@/config/Config'
import verifyToken from '@/middlewares/verifyToken'
import { upload } from '@/api/v1/common/file/config'
import commonImport from '@/api/v1/common/file/import'
import { excelColumns, ruleMap } from '@/common/constants/system/resource'
const router = new KoaRouter({
  prefix: `${Config.API_PREFIX}v1/system/resource`,
})
router.post(
  '/import',
  upload.single('file'),
  verifyToken,
  commonImport({
    tableName: 'system_resource',
    excelColumns,
    ruleMap,
  }),
)
export default router
